package com.itheima.pojo.query;

import com.itheima.pojo.User;
import lombok.Data;

@Data
public class PageQuery <T>{

    /**
     * 分装条件
     * 如果 T=User
     *    body.name
     *    body.gender
     */
    private T body;

    private Integer page;
    private Integer pageSize;

    private Integer index;

    /**
     * 计算索引
     */
    public Integer getIndex(){
        //(当前页-1)*每页条数

        return (page-1)*pageSize;
    }
}
